import { share } from '@/utils/share';
import { useEffect } from 'react';

const ModuleShare = ({ componentCfg: { content } = {} }) => {
  useEffect(() => {
    if (!content) {
      return;
    }

    share(content)
      .then((v) => {
        console.info('分享成功', v);
      })
      .catch((e) => {
        console.warn('分享失败', e);
      });
  }, [content]);

  return null;
};

export default ModuleShare;
